home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / doc / tmac.ansp < prev    next >
Encoding:
Text File  |  1989-11-15  |  6.1 KB  |  380 lines

  1. '#    $Header: tmac.ansp.doc,v 1.12 86/07/11 08:11:34 ouster Exp $ SPRITE (Berkeley)
  2. '#    Troff/Nroff macros for Sprite manual pages
  3. '#     default tabs - set tabs every half inch
  4. .de DT
  5. 'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
  6. ..
  7. '#     set title and heading, initialize parameters
  8. .de TH
  9. .PD
  10. .DT
  11. .AS
  12. .if n .nr )N .5i
  13. .if t .nr )N .5i
  14. .if t .po .8i
  15. .ll 6.5i
  16. .nr LL \\n(.l
  17. .ds ]C \\$1
  18. .ie '\\$3'' .ds ]M  Modified:\\ \\ \\*(DY
  19. .el         .ds ]M  Modified:\\ \\ \\$3
  20. .ie '\\$4'' .ds ]V Sprite v1.0
  21. .el         .ds ]V Sprite \\$4
  22. .ds ]S UNKNOWN SECTION (\\$2)
  23. .if '\\$2'programs'   .ds ]S User Commands
  24. .if '\\$2'prog'       .ds ]S User Commands
  25. .if '\\$2'syscalls'   .ds ]S Library Routines
  26. .if '\\$2'sys'        .ds ]S Library Routines
  27. .if '\\$2'libcalls'   .ds ]S Library Routines
  28. .if '\\$2'lib'        .ds ]S Library Routines
  29. .if '\\$2'libc'       .ds ]S Library Routines
  30. .if '\\$2'devices'    .ds ]S Devices
  31. .if '\\$2'dev'        .ds ]S Devices
  32. .if '\\$2'ioctls'     .ds ]S I/O Control
  33. .if '\\$2'ioc'        .ds ]S I/O Control
  34. .if '\\$2'formats'    .ds ]S Formats
  35. .if '\\$2'form'       .ds ]S Formats
  36. .if '\\$2'headers'    .ds ]S Header Files
  37. .if '\\$2'head'       .ds ]S Header Files
  38. .if '\\$2'misc'       .ds ]S Miscellaneous Commands
  39. .if '\\$2'sx'         .ds ]S Sx Window Library
  40. .wh 0 }H
  41. .if t .wh -1i }F
  42. .if n .wh -1.167i }F
  43. .if \\n(nl .bp 1
  44. .}E
  45. .DT
  46. .nr )I .5i
  47. .nr )R 0
  48. .mk )b
  49. .if !'\\n()b'-1' .bp
  50. ..
  51. '#     NAME section heading
  52. .de NA
  53. .SH "NAME"
  54. ..
  55. '#     SYNOPSIS section heading
  56. .de SY
  57. .br
  58. .SH "SYNOPSIS"
  59. .nf
  60. ..
  61. '#     ARGUMENTS section heading
  62. .de AR
  63. .br
  64. .fi
  65. .SH "ARGUMENTS"
  66. ..
  67. '#     OPTIONS section heading
  68. .de OP
  69. .br
  70. .fi
  71. .SH "OPTIONS"
  72. ..
  73. '#     section heading
  74. .de SH
  75. .}X 0
  76. .nr )E 2
  77. \&\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6
  78. ..
  79. '#     sub section heading
  80. .de SS
  81. .}X \\n()Ru+\\n()Nu
  82. .nr )E 0
  83. \&\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6
  84. .br
  85. ..
  86. '#     Display Start
  87. .de DS
  88. .RS
  89. .nf
  90. ..
  91. '#     Display End
  92. .de DE
  93. .RE
  94. .fi
  95. ..
  96. '#     italic
  97. .de I
  98. .ft 2
  99. .it 1 }N
  100. .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
  101. ..
  102. '#     bold
  103. .de B
  104. .ft 3
  105. .it 1 }N
  106. .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
  107. ..
  108. '#     smaller size
  109. .de SM
  110. .ps -1
  111. .it 1 }N
  112. .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
  113. ..
  114. '#     larger size
  115. .de LG
  116. .ps +1
  117. .it 1 }N
  118. .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
  119. ..
  120. '#     combinations of roman, italic, bold
  121. .de RI
  122. .}S 1 2 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
  123. ..
  124. .de RB
  125. .}S 1 3 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
  126. ..
  127. .de IR
  128. .}S 2 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
  129. ..
  130. .de IB
  131. .}S 2 3 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
  132. ..
  133. .de BR
  134. .}S 3 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
  135. ..
  136. .de BI
  137. .}S 3 2 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
  138. ..
  139. '#        start vertical bar in margin
  140. .de VS
  141. 'mc \s12\(br\s0
  142. ..
  143. '#        end vertical bar in margin
  144. .de VE
  145. 'mc
  146. ..
  147. '#     start a new paragraph
  148. .de LP
  149. .PP
  150. ..
  151. .de PP
  152. .sp \\n()Pu
  153. .ne 2
  154. .}E
  155. .nr )I .5i
  156. .ns
  157. ..
  158. '#     set the inter-paragraph distance
  159. .de PD
  160. .if t .nr )P .5v
  161. .if n .nr )P 1v
  162. .if !"\\$1"" .nr )P \\$1v
  163. ..
  164. '#     start an indented paragraph with label as argument
  165. .de IP
  166. .TP \\$2 \\$3
  167. \&\\$1
  168. ..
  169. '#     define tabbing values for .AP
  170. .de AS
  171. .nr )A 10n
  172. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  173. .nr )B \\n()Au+15n
  174. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  175. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  176. ..
  177. '#      special .IP used for printing command/procedure args
  178. .de AP
  179. .ie !"\\$4"" .TP \\$4 0v
  180. .el \{\
  181. .   ie !"\\$2"" .TP \\n()Cu 0v
  182. .   el          .TP 15 0v
  183. .\}
  184. .ie !"\\$3"" \{\
  185. .ta \\n()Au \\n()Bu
  186. \&\\$1    \\fI\\$2\\fP    (\\$3)
  187. .\}
  188. .el \{\
  189. .br
  190. .ie !"\\$2"" \{\
  191. \&\\$1    \\fI\\$2\\fP
  192. .\}
  193. .el \{\
  194. \&\\fI\\$1\\fP
  195. .\}
  196. .\}
  197. .DT
  198. ..
  199. '#     start an indented paragraph with label on next line
  200. .de TP
  201. .if !"\\$1"" .nr )I \\$1n
  202. .ie !"\\$2"" .sp \\$2
  203. .el          .sp \\n()Pu
  204. .in \\n()Ru
  205. .nr )E 1
  206. .ns
  207. .it 1 }N
  208. .di ]T
  209. ..
  210. '#     set hanging indent
  211. .de HP
  212. .sp \\n()Pu
  213. .ne 2
  214. .if !"\\$1"" .nr )I \\$1n
  215. .ll \\n(LLu
  216. .in \\n()Ru+\\n()Nu+\\n()Iu
  217. .ti \\n()Ru+\\n()Nu
  218. .}f
  219. ..
  220. '#     increase relative indent
  221. .de RS
  222. .nr ]\\n+()p \\n()I
  223. .nr )\\n()p \\n()R
  224. .ie !"\\$1"" .nr )R +\\$1n
  225. .el .nr )R +\\n()I
  226. .nr )I .5i
  227. .}E
  228. ..
  229. '#     decrease relative indent
  230. .de RE
  231. .if !"\\$1"" \{
  232. .   ie "\\$1"0" .nr )p 1 1
  233. .   el          .nr )p \\$1 1
  234. .\}
  235. .ds ]i \\*(]I\\n()p
  236. .ds ]r \\*(]R\\n()p
  237. .nr )I \\*(]i
  238. .nr )R \\*(]r
  239. .if \\n()p .nr )p -1
  240. .}E
  241. ..
  242. '       # BX - place a word in a box
  243. .de BX
  244. .if t \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
  245. .if n \(br\\kA\|\\$1\|\\kB\(br\v'-1v'\h'|\\nBu'\l'|\\nAu'\v'1v'\l'|\\nAu'
  246. ..
  247. '#      BS - start boxed text
  248. .de BS
  249. .br
  250. .mk )a
  251. ..
  252. '#      BE - end boxed text
  253. .de BE
  254. .sp -1
  255. .nf
  256. .ti 0
  257. .ie t \{
  258. \h'-1.5n'\L'|\\n()au-1.5v'\l'\\n(.lu+3n\(ul'\L'-|\\n()au+1.5v'\l'|0u-1.5n\(ul'
  259. .\}
  260. .el \l'\\n(.lu\(ul'
  261. .fi
  262. .br
  263. ..
  264. '#    B1 - same as BS (compatible with -ms)
  265. .de B1
  266. .BS
  267. ..
  268. '#    B2 - same as BE (compatible with -ms)
  269. .de B2
  270. .BE
  271. ..
  272. '#     reset the basic page layout
  273. .de }E
  274. .}f
  275. .in \\n()Ru+\\n()Nu
  276. .ll \\n(LLu
  277. ..
  278. '#     set type font and size
  279. .de }f
  280. .ps 11
  281. .vs 13
  282. .ft 1
  283. ..
  284. '#     print the title line at the head of the page
  285. .de }H
  286. .ev 1
  287. 'sp .5i
  288. .}f
  289. .tl '\\*(]C'\\*(]S'\\*(]C'
  290. 'sp .5i
  291. .ev
  292. .ns
  293. ..
  294. '#     print the title line at the foot of the page
  295. .de }F
  296. .ev 1
  297. .ft 1
  298. .ps 10
  299. 'sp .5i
  300. .tl '\\*(]V'\\*(]M'%'
  301. 'bp
  302. .ev
  303. ..
  304. '#     subroutine to shift fonts
  305. .de }S
  306. .ds ]F
  307. .if "\\$1"2" .if !"\\$5"" .ds ]F\^
  308. .ie !"\\$4"" .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
  309. .el \\$3
  310. .}f
  311. ..
  312. '#     subroutine for section heading
  313. .de }X
  314. .}E
  315. .ti \\$1
  316. .sp \\n()Pu
  317. .ne 2
  318. .nr )R 0
  319. .fi
  320. .it 1 }N
  321. .SM
  322. .B
  323. ..
  324. '#     end of .TP 
  325. .de }1
  326. .ds ]X \&\\*(]T\\
  327. .nr )E 0
  328. .if !"\\$1"" .nr )I \\$1n
  329. .}f
  330. .ll \\n(LLu
  331. .in \\n()Ru+\\n()Nu+\\n()Iu
  332. .ti \\n()Nu
  333. .ie !\\n()Iu+\\n()Ru-\w'\\*(]X'u-3p \{ \\*(]X
  334. .br \}
  335. .el \\*(]X\h'|\\n()Iu+\\n()Ru'\c
  336. .}f
  337. ..
  338. '#     end of SH
  339. .de }2
  340. .nr )E 0
  341. .}E
  342. .nr )I .5i
  343. .ns
  344. ..
  345. '#     handle end of 1-line features
  346. .de }N
  347. .if \\n()E .br
  348. .di
  349. .if "\\n()E"0" .}f
  350. .if "\\n()E"1" .}1
  351. .if "\\n()E"2" .}2
  352. .nr )E 0
  353. ..
  354. '#     EOF handler
  355. .de }K
  356. .}N
  357. .ll \\n(LLu
  358. ..
  359. .em }K
  360. .nr )p 0 1
  361. .ds ]I \\\\n(]
  362. .ds ]R \\\\n()
  363. .ds S \\s11
  364. .bd S 3 3
  365. .hy 14
  366. .if t .tr *\(**
  367. .if \n(mo-0 .ds MO January
  368. .if \n(mo-1 .ds MO February
  369. .if \n(mo-2 .ds MO March
  370. .if \n(mo-3 .ds MO April
  371. .if \n(mo-4 .ds MO May
  372. .if \n(mo-5 .ds MO June
  373. .if \n(mo-6 .ds MO July
  374. .if \n(mo-7 .ds MO August
  375. .if \n(mo-8 .ds MO September
  376. .if \n(mo-9 .ds MO October
  377. .if \n(mo-10 .ds MO November
  378. .if \n(mo-11 .ds MO December
  379. .ds DY \*(MO \n(dy, 19\n(yr
  380.